window.onload=function(){
    //获取smallbox
    var smallbox=document.querySelector('.smallbox');
    //获取bigbox
    var bigbox =document.querySelector('.bigbox');
    var mask=document.querySelector('.mask');
    //绑定 onmouseover
    smallbox.onmouseover=function(){
        bigbox.style.display="block";
        mask.style.display='block';
    }
    //绑定onmouseout
    smallbox.onmouseout=function(){
        bigbox.style.display='none';
          mask.style.display='none';
    }
    smallbox.onmousemove=function(e){
        console.log(e);
        //console.log(smallbox.offsetLeft);
        //console.log(smallbox.offsetTop);
        var maskx=e.clientx -mask.offsetWidth/2;
        var masky=e.clienty -mask.offsetHeight/2;
        mask.style.left=maskx+'px';//样式的值是字符串px
        mask.style.top=masky+'px';
}
}